package edu.zut.cs.software.module.commodity.domain;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import edu.zut.cs.software.teach.Base.domain.BaseTreeEntity;
@Entity
@Table(name = "T_COMMODITYCATEGORY")
@NamedQueries({ @NamedQuery(name = "CommodityCategory.getRoot", query = "select m from CommodityCategory m where m.parent is null") })
public class CommodityCategory extends BaseTreeEntity<CommodityCategory,Long> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4613463945584368077L;
	/**
	 * data of purchase进货日期
	 * 
	 */
	String purchasedata;//进货
	/**
	 * selling data卖出日期
	 */
    String sellingdata;//卖出
    /**
     * remaining剩余日期
     */
    String remainingdata;
    @OneToMany(mappedBy = "commoditycategory", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	List<Commodity> commodity;
	
	public String getPurchasedata() {
		return purchasedata;
	}

	public void setPurchasedata(String purchasedata) {
		this.purchasedata = purchasedata;
	}

	public String getSellingdata() {
		return sellingdata;
	}

	public void setSellingdata(String sellingdata) {
		this.sellingdata = sellingdata;
	}

	public String getRemainingdata() {
		return remainingdata;
	}

	public void setRemainingdata(String remainingdata) {
		this.remainingdata = remainingdata;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
    
}
